package com.example.bottomdrawer;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        BottomDrawer bottomDrawer = findViewById(R.id.bottomdrawer);
        bottomDrawer.setOnDrawerCloseOpenListener(new BottomDrawer.OnDrawerCloseOpenListener() {
            @Override
            public void onDrawerClose(boolean isOpen) {//动画还在执行
                Toast.makeText(MainActivity.this, "close" + isOpen, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onDrawerOpen(boolean isOpen) {//动画还在执行
                Toast.makeText(MainActivity.this, "open" + isOpen, Toast.LENGTH_SHORT).show();
            }
        });
        findViewById(R.id.btn1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "you click the button 1", Toast.LENGTH_SHORT).show();
            }
        });
        findViewById(R.id.btn2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "you click the button 2", Toast.LENGTH_SHORT).show();
            }
        });
    }
}